package com.chengfei.house.web.controller;

import com.chengfei.house.biz.service.UserService;
import com.chengfei.house.common.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author chengfei cheng.fei@chinaott.onaliyun.com
 **/
@Controller
public class HelloController {
    @Autowired
    private UserService userService;
    @GetMapping("hello")
    public String hello(ModelMap modelMap){
        User user = userService.getUsers().get(0);
        modelMap.put("user",user);
        return "hello";
    }

    @GetMapping("index")
    public String index(ModelMap modelMap){
        return "homepage/index";
    }
}
